# list01=[1,2,"python","撒擦"]
# print("list01[1:3]:",list01[1:3])
# print("list01[:3]:",list01[:3])
# print("list01[::3]:",list01[::3])


# age_list = [17,16,18,19,16,20]
# age_list.sort(reverse=True)
# print(age_list)

# list01 =[1,2,3,4,5]
# list01.insert(2,22)
# print(list01)

# #删除元组中元素的方法
# list01 =[1,2,3,4,5]
# element =list01.pop(3)
# print(f"删除元素{element},list01变成{list01}")

# #删除元组中元素的方法
# list01 =[1,2,3,4,5]
# list01.remove(4)
# print(list01)

# #删除元组中元素的方法
# list01 =[1,2,3,4,5,6,7,8,9,10]
# del list01[2]
# print(list01)
# del list01[2:6]
# print(list01)
# del list01[:]
# print(list01)

# 排序
# age_list = [1,5,6,9,7,63,5]
# age_list.sort()
# age_list.sort(reverse=True)
# print(age_list)

# # 元素反转
# pome = "所谓伊人，在水一方"
# pome_list = list(pome)
# print("将诗句转化为列表",pome_list)
# pome_list.reverse()#反转
# print(pome_list)
# pome_reverse="".join(pome_list)#合并
# print(pome_reverse)

# # 临时排序
# age_list = [17,15,13,18,14,19]
# sort_list=sorted(age_list)
# print("",sort_list)
# print("",age_list)

# age_list = [17,15,13,18,14,19]
# sort_list=sorted(age_list,reverse=True)
# print("",sort_list)
# print("",age_list)

# # 列表的复制
# person_hobit = ["狱","的v八十","都不错"]
# friend_hobit = person_hobit[:]
# print("  ",friend_hobit)

# 列表推导式
# square_list=[]
# for item in range(1,11):
#     square_list.append(item ** 2)
# print(square_list)

# origin_list = [1,2,3,4,5,6,7,8,9,10]
# even_list=[]
# for item in origin_list:
#     if item % 2==0:
#         even_list.append(item)
# print(even_list)

# 实战
# run_list=["0time","1time","2time","3time"]
# swim_list=["0miter","1miter","2miter","3miter"]
# print(run_list)
# run_opt=int(input(":"))
# print(swim_list)
# swim_opt=int(input(":"))
# print(f"制定的计划为{run_list[run_opt-1]},{swim_list[swim_opt-1]}")

# 创建元组
# tuple01=tuple()
# tuple02=tuple("hudan")
# tuple03=tuple([1,2,3,4,5])
# tuple04=tuple(range(1,5,2))
# print(tuple01)
# print(tuple02)
# print(tuple03)
# print(tuple04)

# 简易购物系统
# products = [("牛奶",5),("鸡蛋",20),("香蕉",10),("杯子",10)]
# shopping_list=[]
# money=float(input("请输入您的购物资金"))
# while True:
#     print("*"*30)
#     print("商品列表如下:")
#     for index,product in enumerate(products):
#         print(f"{index+1}.商品:{product[0]},价格:{product[1]}")
#     print("*"*30)
#     option=input("请输入您要购买的商品（退出请键入q）：")
#     if option.isdigit():
#         option=int(option)
#         if 0 <= option-1 <=len(products):
#             option_product=products[option-1]
#             if option_product[1] <= money:
#                 shopping_list.append(option_product)
#                 money-=option_product[1]
#                 print("购买成功！")
#             else :
#                 print("余额不足，你的余额为:{money}")
#         else:
#             print("您选的商品不存在！")
#     elif option=='q': 
#         print("退出购物")
#         break

# 编程题
# food=["鸡蛋","牛奶","苹果"]
# xcm_food = sorted(food) # 复制
# xcm_food.append("桃子")
# print(xcm_food)
# xcm_food.remove("牛奶")
# print(xcm_food)
# xcm_food[0]="草莓"
# print(xcm_food)
































